Skip to content

merge wasip2 branch into main#44

Merged
dicej merged 34 commits intospinframework:mainfrom
dicej:wasip2
Mar 27, 2026
Merged

merge wasip2 branch into main#44
dicej merged 34 commits intospinframework:mainfrom
dicej:wasip2

Conversation

@dicej
Copy link
Copy Markdown
Collaborator

@dicej dicej commented Mar 24, 2026

The branch has been hanging out for a while and seems ripe enough to merge.

rajatjindal and others added 24 commits November 10, 2024 14:15
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
update go-modules and cm package. regen bindings
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
feat(wasip2/kv): add support for wasip2 kv
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
Signed-off-by: Adam Reese <adam@reese.io>
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
feat(mqtt): implement mqtt in wasip2
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
feat(redis): implement redis in wasip2
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
feat(mysql): implementing mysql in wasip2
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
Migrate `wasip2` branch to use the new WIT bindings generator
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
Signed-off-by: Joel Dice <joel.dice@akamai.com>
- move v3/* into the root of the repo
- update the v2 packages (e.g. `sqlite`, `pg-outbound`, etc.) to v3
- remove obsolete C-based binding generation
- fix broken tests and examples

Signed-off-by: Joel Dice <joel.dice@akamai.com>
Signed-off-by: Joel Dice <joel.dice@akamai.com>
@adamreese
Copy link
Copy Markdown
Contributor

I'm not sure what the directory for /redis_internal is. Should the contents be in /internal?

@dicej
Copy link
Copy Markdown
Collaborator Author

dicej commented Mar 25, 2026

I'm not sure what the directory for /redis_internal is. Should the contents be in /internal?

One is for targeting the fermyon:spin/redis-trigger world, while the other is for targeting the fermyon:spin@3.0.0/http-trigger world. I tried combining them, but that caused redis trigger apps to import wasi:http@0.2.0 interfaces which aren't included in the redis-trigger world and which Spin won't provide for inbound redis components.

I'm open to other approaches, but I can't think of any that will work short of updating Spin to allow inbound redis components to import all the same things inbound http components can.

@adamreese
Copy link
Copy Markdown
Contributor

We could change /redis_internal/ to /inbound_redis/internal/ to prevent it from being exported. internal is a special directory name for private packages.

@dicej
Copy link
Copy Markdown
Collaborator Author

dicej commented Mar 25, 2026

We could change /redis_internal/ to /inbound_redis/internal/ to prevent it from being exported. internal is a special directory name for private packages.

Ah, good to know. I'll give that a try, thanks.

Signed-off-by: Joel Dice <joel.dice@akamai.com>
Comment thread examples/redis-outbound/main.go Outdated
return
}

if _, err := db.Exec("INSERT INTO pets VALUES (?, ?, ?, ?)", 5, "Copper", "Foxes", false); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome Copper!

Comment thread http/http.go
// convert the incoming request to go's net/http type
httpReq, err := NewHttpRequest(*request)
if err != nil {
//TODO(rajatjindal): return internal error from here
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajatjindal Does this TODO need to be addressed before merging to main?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, Spin will automatically return a 500 error when the handler returns without sending a response to responseOut first, so this doesn't seem particularly urgent to me.

@dicej dicej force-pushed the wasip2 branch 2 times, most recently from b62d43f to d2cc91f Compare March 25, 2026 23:50
@dicej
Copy link
Copy Markdown
Collaborator Author

dicej commented Mar 26, 2026

Per bytecodealliance/componentize-go#35 and the ensuing conversation, I'm planning to tweak how componentize-go is used a bit more tomorrow so we don't have to pass as many flags to it.

Comment thread examples/variables/go.mod Outdated
Comment thread examples/variables/spin.toml Outdated
Comment thread http/testdata/http/main.go Outdated
@radu-matei
Copy link
Copy Markdown
Member

Running spin build in one of the examples:
(componentize-go installed right before this):

spin b
Building component hello with `componentize-go build`
Error: failed to read path for WIT [wit]

Caused by:
    No such file or directory (os error 2)
Error: Build command for component hello failed with status Exited(1)

@adamreese
Copy link
Copy Markdown
Contributor

@radu-matei This is dependent on bytecodealliance/componentize-go#35

cargo install --locked --git https://github.com/dicej/componentize-go --rev fad2c00f

@adamreese
Copy link
Copy Markdown
Contributor

@dicej We should add a note to the README about installing componentize-go with the rev

dicej added 4 commits March 27, 2026 09:34
Signed-off-by: Joel Dice <joel.dice@akamai.com>
Per bytecodealliance/componentize-go#35, Spin
applications can now refer to WIT files by way of the
`github.com/spinframework/spin-go-sdk/v3` source package; no need for the
application to supply them itself.

That PR also allows us to pass multiple `--world` flags to `componentize-go`,
allowing us to target e.g. the `fermyon:spin/redis-trigger` _and_
`spin:up/platform` worlds at the same time (which is what Spin actually
implements for Redis triggers).

Signed-off-by: Joel Dice <joel.dice@akamai.com>
Signed-off-by: Joel Dice <joel.dice@akamai.com>
Signed-off-by: Joel Dice <joel.dice@akamai.com>
Signed-off-by: Joel Dice <joel.dice@akamai.com>
@dicej dicej merged commit b727e58 into spinframework:main Mar 27, 2026
2 checks passed
@dicej dicej deleted the wasip2 branch March 27, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants